
const domainName = getApp().globalData.domainName
const parameter = getApp().globalData.parameter
// pages/stu_doti_of_chap/stu_doti_of_chap.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
 
  },

  view_chap_detail(e){
    getApp().get_vibration()
    let index = e.currentTarget.id
    let chap_id = this.data.chap_list[index].chap_id
    let chap_name = this.data.chap_list[index].chap_name
    wx.navigateTo({
      url: '/pages/students/chap_doti_rec/chap_doti_rec?chap_id=' + chap_id + '&jg_stu_id=' + this.data.jg_stu_id + '&stu_name=' + this.data.stu_name + '&chap_name=' + chap_name,
    })

  },

  stu_doti_of_chap(jg_stu_id){
    wx.request({
      url: domainName + '/stu_doti_of_chap_init',
      data: {
        jg_stu_id:jg_stu_id,
      },...parameter,
      success: res => {
        this.setData({
          chap_list:res.data.chap_list
        })
      },
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let jg_stu_id = options.jg_stu_id
    let stu_name = options.stu_name
    wx.setNavigationBarTitle({
      title: stu_name + '：练习册',
    })
    this.setData({
      jg_stu_id:jg_stu_id,
      stu_name:stu_name,
    })
    this.stu_doti_of_chap(jg_stu_id)
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

})